package com.lwj.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lwj.dao.MerchantMapper;
import com.lwj.entity.Merchant;
import com.lwj.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by LWJ on 2018/5/14.
 */
@Service
@Transactional
public class MerchantServiceImpl implements MerchantService {

    @Autowired
    private MerchantMapper merchantMapper;

    @Override
    public PageInfo<Merchant> getAllMerchant(int pageNo, int pageSize) {
        PageHelper.startPage(pageNo, pageSize);
        return new PageInfo<>(merchantMapper.findAll());
    }
}
